/**
 * 
 */
package com.easidea.tim.dao.system.orgnization;

import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springside.core.dao.extend.HibernateEntityExtendDao;

import com.easidea.tim.entity.system.orgnization.Department;

/**
 * @author Harrison
 *
 */
public class DepartmentDao extends HibernateEntityExtendDao<Department> {
	private static Logger log = Logger.getLogger(DepartmentDao.class);
	
	/**
	 * 
	 * @return
	 */
	public List<Department> getAllDepartmentList(){
		List<Department> rtnList = null;
		Criteria cte = this.createUnDeletedCriteria();
		cte.add(Restrictions.isNull("parentDept"));
		rtnList = cte.list();
		log.debug("getAllDepartmentList size : "+ rtnList == null ? "null": rtnList.size());
		return rtnList;
	}
}
